<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <!-- 解决网络延迟的问题  -->
    <div id="app">
        <ul>
            <!-- <li v-for="item,index in arr" >
                {{index}}:{{item}}
            </li> -->
            <!-- <li v-for="item,index in json" >
                {{index}}:{{item}}
            </li> -->
            <li v-for="item,index in str" >
                {{index}}:{{item}}
            </li>
        </ul>
        <table>
            <!-- key增加性能  一般吧id放进去 -->
            <tr v-for="item in users" :key='item.id'>
                <td v-for="user in item" >{{user}}</td>
                <!-- <td>{{item.id}}</td> -->
            </tr>
        </table>
    </div>
</body>

<script src="./node_modules/vue/dist/vue.js"></script>
<!-- 可适用异步 -->
<script>
    new Vue({
        el: '#app',
        data: () => {
            return {
                arr:[12,5,8,99],
                json:{
                    a:12,
                    b:18
                },
                str:'dsdgfg',
                users:[
                    {id:1,name:'blue'},
                    {id:4,name:'张三'},
                    {id:3,name:'李四'},
                ]
            } 
        },
        methods: {
            toggle(){
                this.show=!this.show
            }
        }
    })
</script>


</html>